import Vue from 'vue'
import Router from 'vue-router'


Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      alias:'/login',
      name: 'login',
      component: () => import('@/components/login')
    },
    {
      path: '/index',
      name: 'index',
      redirect: '/users',
      component: () => import('@/components/index'),
      children:[
        {
          path: '/home',
          name: 'home',
          component: () => import('@/components/home')
        },
        {
          path: '/users',
          name: 'users',
          component: () => import('@/components/user/users')
        },
        {
          path: '/setting',
          name: 'setting',
          component: () => import('@/components/setting')
        }, 
        {
          path: '/rights',
          name: 'rights',
          component: () => import('@/components/authority/rights')
        },
        {
          path: '/goods',
          name: 'goods',
          component: () => import('@/components/commodity/goods')
        },
        {
          path: '/categories',
          name: 'categories',
          component: () => import('@/components/commodity/categories')
        },
        {
          path: '/addgoods',
          name: 'addgoods',
          component: () => import('@/components/commodity/addgoods')
        },
        {
          path: '/editgoods',
          name: 'editgoods',
          component: () => import('@/components/commodity/editgoods')
        },
        {
          path: '/orders',
          name: 'orders',
          component: () => import('@/components/order/orders')
        },
        {
          path: '/works',
          name: 'works',
          component: () => import('@/components/uploading/works')
        },
        {
          path: '/jointly',
          name: 'jointly',
          component: () => import('@/components/uploading/jointly')
        },
        {
          path: '/cooperation',
          name: 'cooperation',
          component: () => import('@/components/uploading/cooperation')
        },
        {
          path: '/video',
          name: 'video',
          component: () => import('@/components/uploading/video')
        },
        {
          path: '/story',
          name: 'story',
          component: () => import('@/components/uploading/story')
        },
        {
          path: '/sliders',
          name: 'sliders',
          component: () => import('@/components/slider/sliders')
        },
        {
          path: '/reports',
          name: 'reports',
          component: () => import('@/components/statistics/reports')
        }
      ]
    }
  ]
})
